# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-taxii2-client
pkgname=('python2-taxii2-client' 'python-taxii2-client')
_pkgname=cti-taxii-client
pkgver=0.5.0
pkgrel=6
pkgdesc='OASIS TC Open Repository: TAXII 2 Client Library Written in Python.'
arch=('any')
url='https://github.com/oasis-open/cti-taxii-client'
license=('BSD')
makedepends=('git' 'python2-setuptools' 'python-setuptools')
options=(!emptydirs)
source=("https://github.com/oasis-open/cti-taxii-client/archive/v$pkgver.tar.gz")
sha512sums=('d635d98704232f8a89062275a6344bf540f4bbc893ce0071d3cc01aef166b8a211b4e10773f8f6c0ec3b99ffa242113fdb4f21234c9ef7036ba128273f496487')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-taxii2-client() {
  depends=('python2' 'python2-requests' 'python2-six' 'python2-pytz')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-taxii2-client() {
  depends=('python' 'python-requests' 'python-six' 'python-pytz')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

